<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<jsp:useBean id="ProduitService" scope="session" class="controle.service.ProduitService">
</jsp:useBean>

<jsp:useBean id="UtilisateurService" scope="session" class="controle.service.UtilisateurService">
</jsp:useBean>
<%=session.getAttribute("login_infor") %>

<%
   request.setCharacterEncoding("GBK");
   String [][]detail = new String[0][11];
   if(session.getAttribute("InputDetail")!=null){
   detail = (String[][])session.getAttribute("InputDetail");
   }
   else{
   detail = ProduitService.getProduit();
   }
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Page ajouterProduit</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="Mon page web">
	
	
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body><div align="center"><br></div><div align="center"> 
    </div><center>
    <h3 style="background-color: rgb(0, 0, 0);"><font size="6" color="#ff0000">Page ajouterProduit</font></h3>
    <form method="post" action="servlet/goodsinput">
       <input name="idsLength" type="hidden" value="<%=detail.length %>">
       <table cellpadding="5" cellspacing="0" border="1" style="background-color: rgb(192, 192, 192);">
	       <tr align="center">
	          <td style="background-color: rgb(192, 192, 192);">id_produit</td>
	          <td style="background-color: rgb(192, 192, 192);">produitEntreprise<br></td>
	          <td style="background-color: rgb(192, 192, 192);">produitDate<br></td>
	          <td style="background-color: rgb(192, 192, 192);">prix<br></td>
	          <td style="background-color: rgb(192, 192, 192);">produitNom<br></td>
	          
	          <!--<td style="background-color: rgb(192, 192, 192);">noté</td>
	          <td>sold</td>
	          <td>dateDePeremption<br></td>-->
	          
	          
	        
	        
	        </tr>
	        <tr align="center">
	          <td style="background-color: rgb(192, 192, 192);">Mise à jour</td>
	          <td style="background-color: rgb(192, 192, 192);"><input name="newData1" type="text" size="8" value=""></td>
	          <td style="background-color: rgb(192, 192, 192);"><input name="newData2" type="text" size="8" value=""></td>
	          <td style="background-color: rgb(192, 192, 192);"><input name="newData3" type="text" size="8" value=""></td>
	          <td style="background-color: rgb(192, 192, 192);"><input name="newData4" type="text" size="8" value=""></td>
	          <td style="background-color: rgb(192, 192, 192);"><input name="newData5" type="text" size="8" value=""></td>
	          
	          
	          
	          <!--  <td><input name="newData4" type="text" size="5" value=""></td>
	          <td><input name="newData5" type="text" size="15" value=""></td>
	          <td><input name="newData6" type="text" size="15" value=""></td>		
	          <td><input name="newData7" type="text" size="15" value=""></td> -->
	         
	         </tr>
	      <%for(int i=0;i<detail.length;i++){ %>
	       <tr align="center">
	       <td><input name="check<%=i %>" type="checkbox" value="<%=detail[i][0] %>"></td>
	       <td><input name="data1_<%=i %>" type="text" size="8" value="<%=detail[i][0] %>" readonly="readonly"></td>
	       <td><input name="data2_<%=i %>" type="text" size="8" value="<%=detail[i][1] %>"></td>
	       <td><input name="data3_<%=i %>" type="text" size="5" value="<%=detail[i][2] %>"></td>
	       <td><input name="data4_<%=i %>" type="text" size="5" value="<%=detail[i][3] %>"></td>
	       <td><input name="data5_<%=i %>" type="text" size="5" value="<%=detail[i][4] %>"></td>
	       
	       <!-- 
	       <td><input name="data6_<%=i %>" type="text" size="15" value="<%=detail[i][2] %>"></td>
	       <td><input name="data7_<%=i %>" type="text" size="15" value="<%=detail[i][3] %>"></td> -->
	       
	       
	       </tr>
	       <%} %>
	       
	       <tr align="center">
			   <td colspan="8" align="center">
			   <input type="submit" name="action" value="Afficher produit">
			   <input type="submit" name="action" value="Ajouter produit">
			   <input type="submit" name="action" value="Mise à jour">
			   <input type="submit" name="action" value="Supprimer Produit">
			   </td>
		</tr>
    </table>
    </form>
    </center>
  </body>
</html>
